package com.turbofan.service.consumer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.turbofan.service.api.User;
import com.turbofan.service.api.UserApi;


@RestController
public class UcenterController {

    @Autowired
    private UserApi userApi;

    @RequestMapping("query")
    public User query(String username,String password) {
        return userApi.query(username, password);
    }
    
    @RequestMapping("create")
    public String create(String username,String password) {
        User user = new User(username, password);
        return userApi.create(user);
    }
}
